<?php
namespace app\admin\validate;
use think\Validate;

class Cate extends Validate{
    protected $rule = [
        'catename' => 'require|unique:cate|max:10',
        'keywords' => 'require'
    ];

    protected $message = [
        'catename.require' => '栏目名称不能为空',
        'catename.max' => '栏目名称最多不能超过10个字符',
        'catename.unique' => '栏目名称已存在！',

        'keywords.require' =>'关键字不能为空'
    ];

    protected $scene = [
        'edit' => ['catename' => 'max:10']
    ];
}